package com.cmict.data.form.api.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cmict.data.form.api.task.dto.SysFromSeachDataVoDTO;
import com.cmict.data.framework.common.pojo.CommonResult;
import com.cmict.data.form.api.entity.SysTableColumn;
import com.cmict.data.form.api.entity.vo.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

/**
 * 服务类
 *
 * @Author qiaoyu
 * @since 2022-3-15
 */
public interface SysCurrencyService extends IService<Object> {

    CommonResult isAdaptationOldData();

    List<String> getTableNameList(String sql);

    CommonResult createTable(SysFromTableVo sysFromTable);

    CommonResult createFormTableAll(SysFormTableAllVo sysFormTableAllVo);

    CommonResult editFormTableAll(SysFormTableAllVo sysFormTableAllVo);

    CommonResult addcColumnTable(SysFromTableVo sysFromTable);

    CommonResult addColumnTableAll(SysFormTableAllVo sysFormTableAllVo);

    CommonResult deleteColumnTable(String tableName, String columnName);

    CommonResult insertData(SysFromInsertDataVo sysFromInsertDataVo);

    CommonResult insertDataChild(SysFromInsertDataVo sysFromInsertDataVo);

    CommonResult excelInsertData(SysFromInsertDataVo sysFromInsertDataVo);

    CommonResult upData(SysFromUpDataVo sysFromUpDataVo);

    CommonResult upDataList(List<SysFromUpDataVo> sysFromUpDataVoList,String parentId,List<String> repeatVerifyList);

    void deleteData(String job) ;

    void deleteDataAll(String job);

    CommonResult getFormDataAndStatus(Long loginUserId, SysFromSeachDataVoDTO sysFromSeachData);

    Map<Object, Object> getDataOne(String job);

    CommonResult selectData(SysFromSeachDataVo sysFromSeachData);

    CommonResult getTableListExcludeForm(Long formId,String tableName);

    CommonResult alterTableSt(SysFromTableStructureVo sysFromTableStructureVo);

    CommonResult selectAllData(String tableName,String form);

    CommonResult selectAllDataForm(String tableName,String form);

    CommonResult selectIdsData(String tableName, String ids);

    List<Map<String,Object>> selectChildData(String tableName, Long id,int versionId);

    CommonResult createTableFlt(SysFromTableVo sysFromTable);

    List<SysTableColumn> getColumn(String tableName);

    List<String> getColumnName(String tableName);

    CommonResult importData(MultipartFile file, String tableName, String updateType,String parentId) throws Exception;

    void importTemplate(String tableName, HttpServletResponse response) throws Exception;

    void getDataOut(String tableName, String ids,String sortField, String sortType, HttpServletResponse response) throws Exception;

    List<String> getTableName();

    Set<String> getData(SysDatasourceVO sysDatasourceVO);

    CommonResult getDataSelect(SysDatasourceVO sysDatasourceVO);

    CommonResult getColumnFormula(SysFromColumnFormulaVo sysFromColumnFormulaVo);

    CommonResult getGatewayColumnFormula(SysFromColumnFormulaVo sysFromColumnFormulaVo);

    String getMax(String tableName, String column);

    CommonResult getEncode(String tableName, String column, TreeMap<String, String> monitorMap, Long encodeId);

    CommonResult createFromExcel(MultipartFile file) throws Exception;

    Map<Object, Object> getLinkageData(SysLinkAgeDataVo sysLinkAgeDataVo);

    List<SysKeyValueVo> getRelationData(SysLinkAgeDataVo sysLinkAgeDataVo);

    List<Map<Object,Object>> getCascadeData(SysCascadeVo sysCascadeVo);

    String catascadeValue(String sql);

    Map<Object,Object> fromSubmitCheck(SysFieldFormListVo sysFieldFormListVo, String tableName);

    CommonResult formFieldRules(SysFormFieldRulesVo sysFormFieldRulesVo);

    List<Map<String,Object>> getDistanceData(String disTableName, String disFieldName, String dislinkName);

    List<String> getTableNameListForm(String sql);

    CommonResult updatatablecolumn(SysFromTableVo sysFromVo);

    CommonResult getDataSunRemoval(String tableName, String fieldName, String type);

    void vesDataPocDownload(List<String> vesList, HttpServletResponse response);

    void vesDataPocDownloadAll(String tableName, List<String> fieldNameList, HttpServletResponse response);

    CommonResult isNullFile(String tableName, List<String> fieldNameList, HttpServletResponse response);

    List<Map<String,Object>> isDataRepeat(String sql);

    String getDataId(String sql);

    String getCreator(String sql);

    CommonResult excelInputChildForm(MultipartFile file,String tableName) throws Exception;

    CommonResult getVesion(String tableName,Long id) throws Exception;

    CommonResult getJsData(String tableName,String fieldName,String fieldType,String value) throws Exception;

}
